/**
 * 
 */
package com.jdy.haoduoaiteacher.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.jdy.haoduoaiteacher.activity.PublishPhotoActivity;
import com.jdy.haoduoaiteacher.util.CommonUtil;
import com.umeng.analytics.MobclickAgent;
import com.ycsj.goldmedalnewconcept.R;

import org.droidparts.annotation.inject.InjectView;

/**
 * @author zp 2016-5-17 下午5:51:07
 */
public class TabNewDiscoverFragment extends BaseFragment implements OnClickListener {

  private static final String TAG = TabNewDiscoverFragment.class
          .getSimpleName();

  @InjectView(id = R.id.img_publishphoto, click = true)
  private ImageView img_publishphoto; // 发布照片

  @InjectView(id = R.id.img_parentjob, click = true)
  private ImageView img_parentjob; // 家长作业

  @InjectView(id = R.id.img_familyactivity, click = true)
  private ImageView img_familyactivity; // 家庭活动

  @InjectView(id = R.id.img_dianming, click = true)
  private ImageView img_dianming; // 我要点名

  @InjectView(id = R.id.img_notifyparent, click = true)
  private ImageView img_notifyparent; // 通知家长

  @InjectView(id = R.id.img_babygo, click = true)
  private ImageView img_babygo; // 宝贝加油

  @Override
  public void onDestroy() {
    super.onDestroy();
  }

  @Override
  public View onCreateView(Bundle savedInstanceState, LayoutInflater inflater,
                           ViewGroup container) {
    View bodyView = LayoutInflater.from(mContext).inflate(
            R.layout.new_finder_layout_teacher, container, false);

    return bodyView;
  }

  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    img_publishphoto.setOnTouchListener(CommonUtil.VIEW_TOUCH_DARK);
    img_parentjob.setOnTouchListener(CommonUtil.VIEW_TOUCH_DARK);
    img_familyactivity.setOnTouchListener(CommonUtil.VIEW_TOUCH_DARK);
    img_dianming.setOnTouchListener(CommonUtil.VIEW_TOUCH_DARK);
    img_notifyparent.setOnTouchListener(CommonUtil.VIEW_TOUCH_DARK);
    img_babygo.setOnTouchListener(CommonUtil.VIEW_TOUCH_DARK);
  }

  @Override
  public void onResume() {
    super.onResume();

    MobclickAgent.onPageStart(TAG);
  }

  @Override
  public void onPause() {
    super.onPause();

    MobclickAgent.onPageEnd(TAG);
  }

  @Override
  public void onClick(View v) {
    Intent intent = new Intent();
    switch (v.getId()) {
      case R.id.img_publishphoto:
        intent.setClass(mContext, PublishPhotoActivity.class);
        startActivity(intent);
        break;
      case R.id.img_parentjob:
        CommonUtil.showToask(getActivity(), "敬请期待!");
        break;
      case R.id.img_familyactivity:
        CommonUtil.showToask(getActivity(), "敬请期待!");
        break;
      case R.id.img_dianming:
        CommonUtil.showToask(getActivity(), "敬请期待!");
        break;
      case R.id.img_notifyparent:
        CommonUtil.showToask(getActivity(), "敬请期待!");
        break;
      case R.id.img_babygo:
        CommonUtil.showToask(getActivity(), "敬请期待!");
        break;
      default:
        break;
    }
  }

  @Override
  public void setUserVisibleHint(boolean isVisibleToUser) {
    super.setUserVisibleHint(isVisibleToUser);
    if (isVisibleToUser) {

//

    } else {
      // TODO
    }
  }
}
